<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/WEB-INF/jsp/common/headScript.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>爱普网络效能监测分析系统</title>
<link href="<c:url value='/css/login.css'/>" rel="stylesheet" type="text/css" />
<style type="text/css">
	 body {background:url(images/login/login_bg.gif) repeat-x;overflow:hidden;}
	.usernam{width:100%;height:150px;padding:10px;line-height:24px;}
	.login_main {background: url(images/login/login_bg1.gif) no-repeat 0px 0px; height: 294px; width: 668px; color:#4F779E; line-height:36px;}
	.login_main img {vertical-align:middle;}
	.login_foot {background: url(images/login/login_bg2.gif) no-repeat 0px 0px; height: 45px; width: 668px; font-size:12px; color:#6DA0C4; line-height:45px; text-align:center;}
	.login_input {border:1px solid #AEAEAE; height:20px; line-height:20px; text-indent: 3px;}
	.login_btn {background: url(images/login/login_btn.gif) no-repeat 0px 0px; border:0px; height: 26px; width: 67px; font-size:12px; color:#FFFFFF; line-height:26px; text-align:center;cursor:pointer;}
</style>
<script type="text/javascript">
	    	$(function(){
	    		$(".vc-pic").click(function(){
	    			//刷新验证码
	    			var _url = "ImageServlet?time="+new Date().getTime();
	    			$(".vc-pic").attr('src',_url);
	    		});
	    	});		
	
	    	//用户登陆
	    	function loginPlat(){
	    		if ($('#loginForm').form('validate')){
	    			var data = $('#loginForm').serialize();
	    			$.ajax({
	    				url: '<c:url value="/user/login.do"/>',
	    				type: 'POST',
	    				data: data,
	    				beforeSend: function(XmlHttpRequest, textStatus, errorThrown) {
	    					$.messager.progress({
	    						title:'提示',
	    						msg:'正在登陆，请稍待...'
	    					});
	    				},
	    				success: function(result) {
	    					$.messager.progress('close');
	    					if(result.data == 'success'){
	    						//页面跳转
	    						window.location.href = '<c:url value="/user/main.do"/>';
	    					}
	    					else{
	    						$.messager.alert('错误', result.data, 'error');
	    					}
	    				}
	    			});
	    		}
	    	}
</script>
</head>
<body onkeypress="javascript:if(event.keyCode==13){loginPlat();}">
<form id="loginForm" method="post">
<div class="usernam">&nbsp;
<br/></div>
<table width="668" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr>
    <td height="294" valign="bottom" class="login_main">
    <table border="0" cellspacing="0" cellpadding="0"  style="margin:85px 0px 0px 55px;" style="font-size:12px;line-height:32px;">
      <tr>
        <td align="right">用　户：</td>
        <td><input type="text" class="easyui-validatebox" name="loginName" data-options="required:true,missingMessage:'用户名不能为空.'" style="width:161px;"/></td>
     </tr>
     <tr>
  		<td align="right">密　码：</td>
  		<td><input type="password" class="easyui-validatebox" name="loginPassword" data-options="required:true,missingMessage:'密码不能为空.'" style="width:161px;"/></td>
     </tr>
  	 <tr>
        <td align="right">验证码：</td>
        <td><img class="vc-pic" width="65" height="23" title="点击刷新验证码" src="<c:url value='/ImageServlet?time=new Date().getTime()'/>"/>
			<input class="vc-text easyui-validatebox" data-options="required:true,missingMessage:'验证码不能为空.'" maxlength="4" type="text" name="validateCode"/></td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
      <input type="button" name="button1" value="登 录" class="login_btn" onclick="loginPlat();return false;"/>&nbsp;
      <input type="button" name="button2" value="退 出" class="login_btn" onclick="window.close();"/></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="6%" height="80">&nbsp;</td>
  </tr> 
</table></td>
  </tr>
     <tr><td></td></tr>
  <tr>
    <td class="login_foot"></td>
  </tr>
</table>
</form>
</body>
</html>



